#/usr/bin/python
# coding: utf8

import time
from  PAM30 import PAM30
import win32api
import win32con
import random


def pageDown():
    '''
    单纯按pagedown键，随机停留1-5秒
    '''
    win32api.keybd_event(34, 0, 0, 0)#pagedown
    time.sleep(0.5)
    win32api.keybd_event(34, 0, win32con.KEYEVENTF_KEYUP, 0)
    time.sleep(random.randint(1, 5))


def clickBar():
    bar = ie.findElement('ul', 'id', 'J_TabBar')
    bars = ie.getElementChildren(bar)
    ebar = ie.getElementChildren(bars[2])
    ie.clickElement(ebar[0])



ie= PAM30.PAMIE()
time.sleep(2)

ie.navigate('http://item.taobao.com/item.htm?spm=a230r.1.10.67&id=18204900327')  
pageDown()
pageDown()
pageDown()
pageDown()
pageDown()


time.sleep(2)
clickBar()
